Otherwise, when destroying the domain, if the current sl2 is unpinned
then the shadow page will be freed without accquire the shadow_lock.
This may also improve the performance due to avoiding uncessary
unshadow.
Signed-off-by: Xiaofeng Ling <xiaofeng.ling@intel.com>
int changed;
u32 min_max_shadow, min_max_snapshot;
int min_shadow, max_shadow, min_snapshot, max_snapshot;
+ struct vcpu *v;
ASSERT(shadow_lock_is_acquired(d));
if ( unlikely(unshadow) )
{
+ for_each_vcpu(d, v)
+ if(smfn == pagetable_get_pfn(v->arch.shadow_table))
+ return need_flush;
perfc_incrc(unshadow_l2_count);
shadow_unpin(smfn);
#if CONFIG_PAGING_LEVELS == 2
int changed;
u32 min_max_shadow, min_max_snapshot;
int min_shadow, max_shadow, min_snapshot, max_snapshot;
+ struct vcpu *v;
ASSERT(shadow_lock_is_acquired(d));
if ( unlikely(unshadow) )
{
+ for_each_vcpu(d, v)
+ if(smfn == pagetable_get_pfn(v->arch.shadow_table))
+ return need_flush;
perfc_incrc(unshadow_l2_count);
shadow_unpin(smfn);
if ( unlikely(shadow_mode_external(d)) )